<template>
	<!-- 按钮 -->
	<view class="pages">
		<view class="pages-button" :class="{noFixed: !isPosition, isFixed: isPosition}">
			<u-button :type='type' :custom-style="bottonStyle" @click="submit" :plain="true">{{ name }}</u-button>
		</view>
	</view>
</template>

<script>
	export default {
		props: {
			//按钮名字
			name: {
				type: String,
				default: '确定'
			},
			isPosition: {
				type: Boolean,
				default: true
			},
			bottonStyle: {
				type: Object,
				default: () => {
					return {
						backgroundColor: '#e0f0ff',
						color: '#65a0ff',
						margin: '10rpx 0'
					}
				}
			},
			type: {
				type: String,
				default: 'default'
			}
		},
		created() {

		},
		data() {
			return {};
		},
		methods: {
			//点击提交按钮
			submit() {
				this.$emit('submit', true);
			},
		}
	};
</script>

<style lang="scss" scoped>
	.pages {
		width: 100%;
		display: flex;
		justify-content: center;

		.pages-button {
			width: calc(100% - 100rpx);
			z-index: 2;
			width: 100%;

			&.noFixed {
				// padding-bottom: 80rpx;
			}

			&.isFixed {
				position: fixed;
				bottom: 50rpx;
			}
		}
	}
</style>